#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QHBoxLayout>
#include <QFileDialog>
#include <QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QHBoxLayout *layout = new QHBoxLayout;
    this->centralWidget()->setLayout(layout);
    layout->addWidget(ui->pushButton);
    layout->addWidget(ui->pushButton_2);


}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    const QString &filePath = QFileDialog::getOpenFileName(this,"打开文件","C:/Users/LKM/Code/qt/","图片文件(*.png);;源文件(*.cpp)");
    qDebug() << filePath;
}

void MainWindow::on_pushButton_2_clicked()
{
    const QString &filePath = QFileDialog::getSaveFileName(this,"保存文件");
    qDebug() << filePath;
}
